<!DOCTYPE html>

<html lang="zh-CN">

<head>

    <title>{$footcompany.web_site_title}</title>

    <meta name="keywords" content="{$footcompany.web_site_keyword}">

    <meta name="description" content="{$footcompany.web_site_description}">

    <meta charset="UTF-8">

    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">

    <link rel="stylesheet" href="/static/index/css/plugins-2.2.css">

    <link rel="stylesheet" href="/static/index/css/theme-2.2.css">

    <link rel="stylesheet" href="/static/index/css/frontend.min.css">

    <link href="{$footcompany.web_site_ico}" type="image/x-icon" rel="shortcut icon" />

    <script src="/static/index/js/jquery.min1.js"></script>

</head>



<body>

{include file="../application/index/view/common/header.html" /}

<div id="content-container" class="container">

    <div class="row">

        <div class="col-md-3">

            <div class="sidenav">

                {include file="mycommon/myleft"}
            </div>

        </div>

        <div class="col-md-9">

            <div class="panel panel-default panel-page">

                <div class="panel-heading">

                    <h2>修改密码</h2>

                </div>

                <div class="panel-body">

                    <form id="form4" onsubmit="return false" action="##" method="post" class="form-horizontal nice-validator n-default n-bootstrap" role="form">              

                        <div class="form-group">

                            <label for="oldpassword" class="control-label col-xs-12 col-sm-2">旧密码:</label>

                            <div class="col-xs-12 col-sm-4">

                                <input type="password" class="form-control" id="oldpassword" name="oldpassword" value="" placeholder="旧密码">

                            </div>

                        </div>

                        <div class="form-group">

                            <label for="newpassword" class="control-label col-xs-12 col-sm-2">新密码:</label>

                            <div class="col-xs-12 col-sm-4">

                                <input type="password" class="form-control" id="newpassword" name="newpassword" value="" placeholder="新密码">

                            </div>

                        </div>

                        <div class="form-group">

                            <label for="renewpassword" class="control-label col-xs-12 col-sm-2">确认新密码:</label>

                            <div class="col-xs-12 col-sm-4">

                                <input type="password" class="form-control" id="renewpassword" name="renewpassword" value="" placeholder="确认新密码">

                            </div>

                        </div>

                        <div class="form-group normal-footer">

                            <label class="control-label col-xs-12 col-sm-2"></label>

                            <div class="col-xs-12 col-sm-8">

                                <button type="button" onclick="updatepwd()" class="btn btn-success btn-embossed">提交</button>

                            </div>

                        </div>

                    </form>

                </div>

            </div>

        </div>

    </div>

</div>

<div class="layui-layer layui-layer-dialog layui-layer-border layui-layer-fast layui-layer-fast-msg layui-layer-hui" id="parent-msg" style="z-index: 19891021; top: 251.5px; left: 884.5px;display: none;">

    <div id="msg" class="layui-layer-content"></div>

</div>

<!-- 底部 -->

{include file="../application/index/view/common/foot.html" /}

<script>

    function updatepwd(){

        $.ajax({

            //几个参数需要注意一下

            type: "POST",//方法类型

            url: "/my/updatepwd" ,//url

            data: $('#form4').serialize(),

            success: function (result) {

                if (result.code == 200) {

                    $("#parent-msg").show().delay(1000).hide(300);

                    $("#msg").text(result.msg);

                    window.location.href = '/user/login';

                }else{

                    $("#parent-msg").show().delay(1000).hide(300);

                    $("#msg").text(result.msg);

                }

            },

            error : function() {

                $("#parent-msg").show().delay(1000).hide(300);

                $("#msg").text('系统错误，请重试！');

            }

        });

    }

</script>

</div>

</body>

</html>